<style>
	.bac-color-f8 {
		background-color: #376eff;
	}
	.danger{
		background-color: #f39c12;
	}
	.btn-success{
		background-color: #d8e0e6;
		color: #95a5a6;
	    background-color: #d8e0e6;
	    border: 1px solid #e8edf0;
	
	}
	.btn-play{
		background-color: #18bc9c;
		color: #fff;
		border-radius: 3px;
	}
	.cancel-btn,.detail-btn,.info-btn{
		background-color: #f6f6f6;
		color: #7b7b7b;
		border-radius: 3px;
	}
	.thisBtnPad{
		padding: 4rpx 8rpx;
	}
</style>
<template>
	<view class="order-item mar-t-10 flex flex-column over-hid bac-color-normal pad-10">
		
		<view class="">
			<view class="font-color-fff font-size-15 tq-text-line1">
				<text>预约咨询师：{{item.name}}</text>
				<!-- <slot name="name"></slot> -->
			</view>
			<view class="font-color-fff font-size-13 mar-t-10 flex align-center justify-between">
				<text>预约时间：{{transformTime(item.start_time)}}</text>
				<text>咨询方式：{{item.way_text}}</text>
			</view>
		</view>
		<view class="flex align-center justify-end font-size-13 mar-t-10">
			<view class="btn detail-btn thisBtnPad mar-l-5" @click="catInfo(item.order_no)">
				查看详情
			</view>
			<view class="btn cancel-btn thisBtnPad mar-l-5" v-if="item.status==0">
				已过期
			</view>
			<view class="btn cancel-btn thisBtnPad mar-l-5" @click="orderCancel(item.order_no)"  v-if="item.status==1">
				取消预约
			</view>
			<view class="btn info-btn mar-l-5 thisBtnPad" @click="catInfo(item.order_no)" v-if="item.status==2">
				查看反馈信息
			</view>	
			<navigator
				hover-class="none"
				:url="'/pages/order/evaluate?order_no='+item.order_no+'&type=consult_order'"
				class="btn yellow-btn thisBtnPad mar-l-5" v-if="item.status == 2"
			>
				去评价
			</navigator>
			<view class="btn btn-success thisBtnPad mar-l-5" v-if="item.status == 3">
				已完成
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: ['item'],
	data() {
		return {}
	},
	methods: {
		goChat(session_id) {
			this.href('/pages/chat/index?session_id=' + session_id)
		},
		orderCancel(order_no) {
			let _that = this
			uni.showModal({
				title: '提示',
				content: '真的要取消预约吗',
				success(res) {
					if (res.confirm) {
						_that.$emit('orderCancel', {
							order_no,
							type: 'consult_order'
						})
					}
				}
			})
		},
		catInfo(order_no)
		{
			this.href('/pages/order/info?order_no='+order_no)
		},
	}
}
</script>
